#include "kdpch.h"
#include "UniformBuffer.h"

#include "KuaDu/Renderer/Renderer.h"
#include "Platform/OpenGL/OpenGLUniformBuffer.h"

namespace KD {

    Ref<UniformBuffer> UniformBuffer::Create(uint32_t size, uint32_t binding)
    {
        switch (Renderer::GetAPI())
        {
            case RendererAPI::API::None: KD_CORE_ASSERT(false, "目前不支持RendererAPI::API::None"); return nullptr;
            case RendererAPI::API::OpenGL: return CreateRef<OpenGLUniformBuffer>(size, binding);
        }

        KD_CORE_ASSERT(false, "未知的RendererAPI");
        return nullptr;
    }

}